<div class="btn-group">
  <button type="button" class="btn btn-success dropdown-toggle hospital_title_header" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  {{$hospital->name}}
  </button>
  <div class="dropdown-menu">
    @foreach($hospitals as $k=>$field)
    <a class="dropdown-item hospital_title_item" href="/?admin_hospital_id={{$field->id}}">{{$field->name}}</a>
    @endforeach
  </div>
</div>

<script>
    // js代码也可以放在模板里面
    console.log('所有JS脚本都加载完了!!!');
    Dcat.ready(function () {
        $(document).off('click', '.hospital_title_item').on('click', '.hospital_title_item', function (e) {
            var html = e.target.innerText;
            $('.hospital_title_header').html(html);
        })
    });
</script>
